package com.cloud.animationtestdemo.utils

import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent

/**
 * @author: njb
 * @date:   2024/12/27 23:43
 * @desc:   描述
 */
class MyActivityLifecycleObserver :LifecycleObserver{
    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    fun onCreate() {
        println("Activity is created")
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    fun onStart() {
        println("Activity is started")
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    fun onResume() {
        println("Activity is resumed")
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    fun onPause() {
        println("Activity is paused")
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    fun onStop() {
        println("Activity is stopped")
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    fun onDestroy() {
        println("Activity is destroyed")
    }
}